﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FCategoryNav.ascx.cs" Inherits="Goods_FCategoryNav" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<%@ Import Namespace="Shopping.BLL" %>
<%@ Import Namespace="System.Collections.Generic" %>
  <%
        if(menu != null)
        {
            CategoryMenu c = menu;
            IDNameObj fc = c.FCategory;
            List<IDNameObj> listOfSC = c.SCategorys;

            Response.Write("<h1 class=\"titleOne \">");
            Response.Write("<a href=\""+bllUrl.GetGoodsListUrl(fc.ID)+"\">");
            Response.Write(fc.Name);
            Response.Write("</a>");
            Response.Write("</h1>");
            if (listOfSC != null)
            {
                Response.Write("<ul class=\"importedFoods\">");
                for (int j = 0; j < listOfSC.Count; ++j)
                {
                    IDNameObj sc = listOfSC[j];
                    List<IDNameObj> listOfTC = null;
                    if (c.TCategorys.ContainsKey(sc.ID))
                        listOfTC = c.TCategorys[sc.ID];

                    Response.Write("<li  class=\"topLineLi\">");
                    Response.Write(" <h2 class=\"dairyTitle\">");
                    Response.Write("<a class=\"greenTitle\" href=\""+ bllUrl.GetGoodsListUrl(fc.ID,sc.ID) +"\">");
                    Response.Write(sc.Name);
                    Response.Write("</a>");
                    Response.Write("</h2>");
                    if (listOfTC != null)
                    {
                        for (int m = 0; m < listOfTC.Count; ++m)
                        {
                            if (m == 0 || (m + 1) % 2 > 0)
                            {
                                Response.Write("<p class=\"dairyP\">");
                                Response.Write("<a  href=\"" + bllUrl.GetGoodsListUrl(fc.ID, sc.ID, listOfTC[m].ID) + "\" >");
                            }
                            else
                                Response.Write("<a  href=\"" + bllUrl.GetGoodsListUrl(fc.ID, sc.ID, listOfTC[m].ID) + "\" class=\"dairyA\">");
                            Response.Write(listOfTC[m].Name);
                            Response.Write("</a>");
                            if ((m + 1) == listOfTC.Count || (m + 1) % 2 == 0)
                               Response.Write("</p>");
                        }
                    }
                    Response.Write("</li>");
                }
                Response.Write("</ul>");
            }

        } 
            
       %>


